package com.yvtian.admin.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yvtian.admin.pojo.SysUser;
import com.yvtian.admin.vo.UserInfoResponse;
import com.yvtian.admin.vo.UserVO;
import com.yvtian.entity.Result;
import com.yvtian.exception.UserInvalidException;
import com.yvtian.exception.UserRegisteredException;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * 用户(SysUser)表服务接口
 *
 * @author long
 */
public interface SysUserService extends IService<SysUser> {

    UserInfoResponse findCurrentUserById(String userId);

    UserInfoResponse findUserById(String userId);

    void register(SysUser user) throws UserRegisteredException;

    Map<String, Object> login(Map<String, String> map) throws UserInvalidException;

    void logout(String tokenId) throws Exception;

    IPage<SysUser> findByPage(Page<SysUser> sysUserPage, SysUser sysUser);

    List<UserInfoResponse> findList(String ids);

    void updateUser(SysUser SysUser);

    Result delUser(Map<String, Object> map);

    Result delUserById(String userId);

    /**
     * 重置密码
     * @param id
     */
    void restPassword(String id);

    /**
     * 修改密码
     */
    Result updatePassword(String userId,String oldPwd,String newPwd);

}
